package com.kyrie.controller;

import com.kyrie.utils.GlobalConstants;
import com.kyrie.vo.ResponseBean;
import com.kyrie.vo.UserInfoVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

/***
 * 描述: 处理异常的重定向controller
 *
 * @author wuxiang
 * @date 2020-04-07 23:50
 */
@RestController
public class ErrorController {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @RequestMapping(value = "/500",method = RequestMethod.GET)
    public ResponseBean<UserInfoVO> error500 (String errorMsg) {
        logger.info("拦截到/500 的错误请求信息为：{}",errorMsg);
        return ResponseBean.success(null,GlobalConstants.FAIL_CODE,errorMsg);

    }
}
